import request from './request'

const sysHead ={
  "tranDate": '20230111',
  "seqNo": Math.floor(Math.random()*1000)+1,
  "subSeqNo":Math.floor(Math.random()*1000)+1
}
export function login(userId, password) {
  const data = {
    sysHead,
    "body": {
      "userId": userId,
      "passwd": password
    }
  }
  return request({
    url: '/boot/find/user/info',
    method: 'post',
    data: data
  })
}
export function register(userId, password,sex,iphone,birthday) {
  const data = {
    sysHead,
    "body": {
      "flag":'I',
      "userId": userId,
      "passwd": password,
      "sex": sex,
     /* "address": address,*/
      "iphone": iphone,
      "birthday": birthday
    }
  }
  return request({
    url: '/boot/register/user/info',
    method: 'post',
    data: data
  })
}
export function updateInfo(userId, password,sex,address,iphone,birthday) {
  const data = {
    sysHead,
    "body": {
      "flag":'U',
      "userId": userId,
      "passwd": password,
      "sex": sex,
      "address": address,
      "iphone": iphone,
      "birthday": birthday
    }
  }
  return request({
    url: '/boot/register/user/info',
    method: 'post',
    data: data
  })
}
